package com.xinda.admin.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xinda.admin.dao.OrderMapper;
import com.xinda.admin.pojo.ServiceOrder;
import com.xinda.admin.vo.OrderEditVo;
import com.xinda.admin.vo.OrderListVo;

@Service
public class OrderService {
	
	@Autowired
	OrderMapper ordermapper;

	public List<OrderListVo> queryOrderByStatus(Map<String, String> map) {
		return ordermapper.selectOrderByStatus(map);
	}
	
	public OrderEditVo queryQrderEditVoById(int id){
		return ordermapper.selectOrderEditVoById(id);
	}
	
	public void updateOrderStatusById(ServiceOrder serviceOrder){
		ordermapper.updateOrderStatusById(serviceOrder);
	}

	public void updateOrderTotalPriceByOrderEditVo(OrderEditVo orderEditVo) {
		ordermapper.updateOrderTotalPriceByOrderEditVo(orderEditVo);
	}
	
	public void closeOrdersStatusByIds(OrderListVo orderListVo) {
		ordermapper.closeOrdersStatusByIds(orderListVo);
	}
}
